# -*- coding: utf-8 -*-
#还原模块
import restoration.cube as  cube
import restoration.claw as claw
import restoration.command as command

def restorateByStm32(res):
    command.solve(res);

#根据传过来的解法，去调用对应的方法，对魔方进行还原
def restorate(res):
    for i in range(len(res)):
        if res[i]!="'" and res[i]!="2" :
            if i==len(res)-1:
                cube.turn(res[i],cube.TURN_POSITIVE,90);
            else:
                if res[i+1]=="'":
                    cube.turn(res[i],cube.TURN_NEGATIVE,90);
                elif res[i+1]=="2":
                    cube.turn(res[i],cube.TURN_NEGATIVE,180);
                else :
                    cube.turn(res[i],cube.TURN_POSITIVE,90);

